home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.01 Jan 90 / XDemo Source / subtract20.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-06  |  765 b   |  38 lines  |  [TEXT/MPS ]

  1. /*----------- Subtract20.c -------------*/
  2. /*A sample external function for XDemo.
  3. by Mark Lankton, 1989 for MacTutor
  4. */
  5. #include <types.h>
  6. #include <resources.h>
  7. #include <OSUtils.h>
  8. #include <OSEvents.h>
  9. #include <SANE.h>
  10. #include <math.h>
  11. #include <stdlib.h>
  12.  
  13. typedef struct XTRABlock{
  14.         int            dataLength;
  15.         short        *theData;
  16.         }XTRABlock,*XTRABlockPtr,**XTRABlockHandle;
  17.         
  18. #define TRUE     0xFF;
  19. #define FALSE     0x00;
  20.  
  21.  
  22. /************************** prototype *********************/
  23. pascal Boolean Subtract20(XTRABlock    *blockPtr);
  24.  
  25. /************************** function **********************/
  26. pascal Boolean
  27. Subtract20(blockPtr)
  28.     XTRABlock *blockPtr;
  29. {
  30.     int            i;
  31.     
  32.     for(i = 0; i < blockPtr->dataLength;i++)
  33.         {
  34.         *((blockPtr->theData) + i) -= 20;
  35.         }
  36.     return TRUE;
  37.  
  38. }